package com.micro.service.account.share.service;

import com.micro.service.account.share.dto.UserBaseDto;
import com.micro.service.account.share.dto.UserWechatDto;
import com.micro.service.common.dto.ResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author lvxiucai
 * @description 用户信息
 * @date 2020/4/9
 */
@FeignClient(value = "account-server")
@RequestMapping(value = "/account/v1/user")
public interface UserBaseService {


    /**
     * @author lvxiucai
     * @description 根据手机号查询用户
     * @date 2019/9/3
     * @param mobile
     * @return
     **/
    @RequestMapping(value = "/loadByMobile",method = RequestMethod.POST)
    ResultDTO<UserBaseDto> selectByMobile(@RequestParam(value = "mobile") String mobile);

    /**
     * @author lvxiucai
     * @description 根据用户id查询用户信息
     * @date 2020/4/13
     * @param userId
     * @return
     **/
    @RequestMapping(value = "/selectByUserId",method = RequestMethod.POST)
    UserBaseDto selectById(Long userId);

    /**
     * @author lvxiucai
     * @description 根据手机号检查并注册用户
     * @date 2020/4/14
     * @param
     * @return
     **/
    @RequestMapping(value = "/checkAndRegisterByMobile",method = RequestMethod.POST)
    ResultDTO<UserBaseDto> checkAndRegisterByMobile(@RequestParam(value = "mobile") String mobile,@RequestParam(value = "client_imei") String imei);

    /**
     * @author lvxiucai
     * @description 更新用户基础信息
     * @date 2020/4/14
     * @param requestDto
     * @return
     **/
    @RequestMapping(value = "/updateUserBase",method = RequestMethod.POST)
    ResultDTO<Boolean> updateUserBase(UserBaseDto requestDto);

    /**
     * @author lvxiucai
     * @description 根据微信信息检查并注册
     * @date 2020/4/15
     * @param userWechatDto
     * @return
     **/
    @RequestMapping(value = "/checkWxExistsAndRegistry",method = RequestMethod.POST)
    UserBaseDto checkWxExistsAndRegistry(UserWechatDto userWechatDto);

    /**
     * @author lvxiucai
     * @description 根据微信openid查询微信用户信息
     * @date 2020/4/15
     * @param openid
     * @return
     **/
    @RequestMapping(value = "/loadUserByWechatOpenid",method = RequestMethod.POST)
    UserBaseDto loadUserByWechatOpenid(String openid);
}
